<?php
class View_Administration_User_Status extends View_Administration_User
{
	/**
	 *	Builds Status View.
	 *	@access		public
	 *	@return		string
	 */
	public function buildContent()
	{
		$config		= $this->registry->get( 'config' );
		$request	= $this->registry->get( 'request' );
		$session	= $this->registry->get( 'session' );
		$auth		= $this->registry->get( 'auth' );
		$words		= $this->words['user']['editStatus'];
		$userId		= $request->get( 'userId' );

		$logic		= new Logic_User();
		$status		= $logic->getUserStatus( $userId );
		$data['set_status']	= (string) $status;
		$data['status']		= $this->getStatusIcon( $status )." ".$this->words['user']['user_states'][$status];
		$opt_status	= $this->words['user']['user_states'];
		unset( $opt_status[0] );
		$opt_status['_selected']	= $status;
		$sources	= array(
			'opt_status'	=> $opt_status,
			);

		$ui	= array(
			'words'	=> $words,
			'form'	=> $this->buildForm(
				'administration/user',
				'editStatus',
				'user',
				'editStatus',
				$data,
				$sources
			),
			'buttonEdit'	=> $this->html->Button(
				'editStatus',
				$words['button_edit'],
				'buthot edit',
				$words['button_edit_confirm']
			),
			'form.tag'		=> $this->html->Form(
				'editStatus',
				"?link=".$request->get( 'link' )."&userId=".$userId
			),
			'caption'	=> $this->html->TableCaption( $words['caption'], 'edit' ),
			'colgroup'	=> $this->html->ColumnGroup( $words['colgroup'] ),
		);
		return $this->loadTemplate( 'administration.user.status', $ui );
	}
}
?>